<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/layout/dialogLayout.xhtml">

 	<ui:param name="param_panelTitle" value="添加产品信息"/>
 	<ui:param name="param_panelWidth" value="450px"/>
	
	<ui:define name="content">
	      <ui:decorate template="/components/formTemplate.xhtml">
	            <ui:param name="id" value="userForm"/>
	            <ui:param name="param_headerTitle" value="添加产品" />
	            <ui:define name="fields">
					<rg:inputText id="name" label="产品名称" value="#{productAction.product.name}" required="true"/>
					<rg:inputText id="specification" label="产品规格" value="#{productAction.product.specification}" required="true"/>
					<rg:inputText id="price" label="产品价格" value="#{productAction.product.price}" required="true"/>
					<rg:selectOne id="productType" label="产品类型" value="#{productAction.productType}" required="true"
						itemsProvider="#{productTypeProvider}" converter="#{productTypeConverter}" style="width:100px;"/>
					<rg:selectOne id="productAgent"  required="true"  label="代理类别" value="#{productAction.product.productAgent}" 
	                    converter="#{productAgentConverter}" itemsProvider="#{productAgentProvider}"/>
			</ui:define>
			<ui:define name="panelButton">
					<a:commandButton styleClass="button" value="#{messages.btn_complete}" 
						onclick="UI.instance.showMask()" oncomplete="UI.instance.reRender('reRenderProductTable');"
						actionListener="#{productAction.addProduct()}" reRender="globalMessage" />
						
					<a:commandButton styleClass="button" value="取消" onclick="UI.instance.closeDialog()"/>
            </ui:define>
			</ui:decorate>
	</ui:define>
</ui:composition>
